<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			let d1 = new Date();
			let d2 = new Date(2025, 12, 25);
			let c = d2.getTime() - d1.getTime();
			console.log(c);
			console.log(Math.floor(c / (24 * 3600 * 1000)));
			//2020年8月6号距离2025年12月25号有多少天？
			// console.log(cal(2020, 12, 31) - cal(2020, 8, 6));
			let d = cal(2020, 12, 31) - cal(2020, 8, 6) + cal(2021, 12, 31)
			 + cal(2022, 12, 31) + cal(2023, 12, 31) + cal(2024, 12, 31) + cal(2025, 12, 25);
			console.log(d);
			function cal(year, month, day) {
				// let input_year = document.getElementById("input_year");
				// let input_month = document.getElementById("input_month");
				// let input_day = document.getElementById("input_day");
				// let year = parseInt(input_year.value);
				// let month = parseInt(input_month.value);
				// console.log(typeof(month));
				// let day = parseInt(input_day.value);
				switch(month) {
					case 12:
						day += 30;
					case 11:
						day += 31;
					case 10:
						day += 30;
					case 9:
						day += 31;
					case 8:
						day += 31;
					case 7:
						day += 30;
					case 6:
						day += 31;
					case 5:
						day += 30;
					case 4:
						day += 31;
					case 3:
						if(isRun(year)) {
							day += 29;
						}else{
							day += 28;
						}
						
					case 2:
						day += 31;
					case 1:
				}
				console.log(day);
				return day;
			}
			
			function isRun(year) {
				if((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
					return true;
				}
				
				return false;
			}
		</script>
	</body>
</html>
